#pragma once

#include "Socket.h"
#include "InetAddr.h"

class Acceptor
{
public:
    Acceptor(const string &ip, unsigned int port);
    ~Acceptor();
    void ready(); // reuse bind listen
    int accept(); // get a new connection fd
    int fd();
private:
    void setReuseAddr();
    void setReusePort();
    void bind();
    void listen();


private:
    Socket _socket;
    InetAddr _address;
};